﻿
@{
    Layout = null;
}

@{
    Layout = null;
}
@using EFEntity
@model IEnumerable<Esalary_grant>
@*薪酬发放登记查询*@
<script src="~/Scripts/vue.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<link href="~/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
<div id="app">
    <form method="post" action="/HR_Fist/salaryGrant/salaryGrantAction!toCheckList">
        <table width="100%">
            <tr>
                <td style="text-align:left;">
                    <font color="black">您正在做的业务是:人力资源管理--薪酬发放管理--薪酬发放登记查询</font>
                    <br /><br /><br />
                </td>
            </tr>


        </table>

        <table width="100%" border="1" cellpadding=0 cellspacing=1
               bordercolorlight=#848284 bordercolordark=#eeeeee
               class="table table-bordered">
            <tr class="alert-info">
                <td width="10%" class="TD_STYLE1">
                    <span>薪酬编号</span>
                </td>
                <td width="20%" class="TD_STYLE1">
                    <span>I级机构名称</span>
                </td>
                <td width="20%" class="TD_STYLE1">
                    <span>II级机构名称</span>
                </td>
                <td width="20%" class="TD_STYLE1">
                    <span>III级机构名称</span>
                </td>
                <td width="10%" class="TD_STYLE1">
                    <span>人数</span>
                </td>
                <td width="10%" class="TD_STYLE1">
                    基本薪酬总额(元)
                </td>
               
            </tr>
            @foreach (var item in Model)
            {
        <tr class="TD_STYLE2">
            <td>
                @Html.ActionLink(item.salary_grant_id, "query", new { id = item.sgr_id, sid = item.salary_standard_id, pid = item.salary_grant_id })
            </td>
           
            <td>
                @Html.DisplayFor(modelItem => item.first_kind_name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.second_kind_name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.third_kind_name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.human_amount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.salary_standard_sum)
            </td>
        </tr>
            }
        </table>
        <div align="center" style="font-size: 18px;color: gray">
            &nbsp;&nbsp;总数：
            <font style="color: maroon;font-weight: bold;">@ViewBag.rows</font>
            例
            &nbsp;&nbsp;&nbsp;
            每页显示 <font style="color: maroon;font-weight: bold;">@ViewBag.pageSize</font>
            条
            &nbsp;&nbsp;&nbsp;
            当前第 <font style="color: maroon;font-weight: bold;">@ViewBag.cp</font>
            页
            &nbsp;&nbsp;&nbsp;共
            <font style="color: maroon;font-weight: bold;">@ViewBag.pages</font>
            页
            <a style="color: navy;font-weight: bold" href="/salaryGrant/query_list?currentpage=1&id=@ViewData["bhId"]&sid=@ViewData["sid"]">首页</a>
            @{ ViewData["cp"] = (int)ViewData["cp"] - 1 > 0 ? (int)ViewData["cp"] - 1 : 1;}
            <a style="color: navy;font-weight: bold"
               href="/salaryGrant/query_list?currentpage=@ViewData["cp"]&id=@ViewData["bhId"]&sid=@ViewData["sid"]">上一页</a>
            @{ ViewData["c"] = (int)ViewData["c"] + 1 < ViewBag.pages ? (int)ViewData["c"] + 1 : ViewBag.pages;}
            <a style="color: navy;font-weight: bold"
               href="/salaryGrant/query_list?currentpage=@ViewData["c"]&id=@ViewData["bhId"]&sid=@ViewData["sid"]">下一页</a>
            <a style="color: navy;font-weight: bold"
               href="/salaryGrant/query_list?currentpage=@ViewBag.pages&id=@ViewData["bhId"]&sid=@ViewData["sid"]">末页</a>
        </div>

    </form>
</div>

<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            list: [],
            rows: 0,
            pages: 0,
            currentpage: 1,
            pageSize: 3,
            tpage: 1
        },
        methods: {
            load: function () {
                var t = this;
                $.ajax({
                    url: "/salaryGrant/query_list",
                    type: "post",
                    data: "currentpage=" + t.currentpage,
                    success: function (msg) {
                        var dts = eval("(" + msg + ")");
                        t.list = dts["list"];
                        t.rows = dts["rows"];
                        t.pages = dts["pages"];
                    }
                });
            },
            first: function () {
                this.currentpage = 1;
                this.load();
            },
            prev: function () {
                if (this.currentpage > 1) {
                    this.currentpage--;
                } else {
                    this.currentpage = 1;
                }
                this.load();
            },
            next: function () {

                if (this.currentpage < this.pages) {
                    this.currentpage++;
                } else {
                    this.currentpage = this.pages;
                }
                this.load();
            },
            last: function () {
                this.currentpage = this.pages;
                this.load();
            },
            tiao: function () {
                var hua = $("#huahua").val();
                var hua = this.tpage;
                if (hua > 0 && hua <= this.pages) {
                    this.currentpage = this.tpage;
                }
                else if (hua == "" || hua == null) {
                    this.currentpage = 1;
                }
                else {
                    alert("没有该页数");
                    this.currentpage = 1;
                    this.tpage = "";
                }
                this.load();
            }
        },
        mounted: function () {
            this.load();
        }
    });
</script>

